<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>测试thymeleaf</title>
</head>
<body>
aa<br/>
<div th:text="${username1}"></div>
<div th:text="${session.username2}"></div>
<hr/>
<span th:if="${age>10}">蓝色</span>
<span th:if="${age<10}">红色</span>
<hr/>
<table border="1" width="500">
    <thead>
        <tr>
            <td>编号</td>
            <td>书名</td>
            <td>作者</td>
            <td>价格</td>
            <td>日期</td>
        </tr>
    </thead>
    <tbody>
        <tr th:each="book:${bookList}">
            <td th:text="${book.id}"></td>
            <td th:text="${book.bookname}"></td>
            <td th:text="${book.author}"></td>
            <td th:text="${book.price}"></td>
            <td th:text="${#dates.format(book.publishDate,'yyyy-MM-dd')}"></td>
        </tr>
    </tbody>
</table>

</body>
</html>